using System;
using System.Text;

namespace Calendar {
    public enum AddressType {DOM,INTL,POSTAL,PARCEL,HOME,WORK}

    public class DeliveryAddress {
        private string _postOfficeAddress;
        private string _extendedAddress;
        private string _street;
        private string _locality;
        private string _region;
        private string _postalCode;
        private string _country;
 
        public AddressType DeliveryAddressType;
          
        public DeliveryAddress() {
 
        }
 
        #region Properties
        public string PostOfficeAddress {
            get{return _postOfficeAddress;}
            set{_postOfficeAddress = value;}
        }
        public string ExtendedAddress {
            get{return _extendedAddress;}
            set{_extendedAddress = value;}
        }
        public string Street {
            get{return _street;}
            set{_street = value;}
        }
        public string Locality {
            get{return _locality;}
            set{_locality = value;}
        }
        public string Region {
            get{return _region;}
            set{_region = value;}
        }
        public string PostalCode {
            get{return _postalCode;}
            set{_postalCode = value;}
        }
        public string Country {
            get{return _country;}
            set{_country = value;}
        }
        #endregion
        public override string ToString() {
            StringBuilder sb = new StringBuilder();
              
            sb.Append("ADR;" + Enum.GetName(typeof(AddressType), DeliveryAddressType) + ":");
            sb.Append(_postOfficeAddress + ";");
            sb.Append(_extendedAddress + ";");
            sb.Append(_street + ";");
            sb.Append(_locality + ";");
            sb.Append(_region + ";");
            sb.Append(_postalCode + ";");
            sb.Append(_country + "\r\n");
 
            return sb.ToString();
        }   
    }
}
